package com.yonyou.pmclouds.organization.rmiimpl;

import com.alibaba.dubbo.config.annotation.Service;
import com.yonyou.pmclouds.ApplicationConsts;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.organization.entity.RoleDistributeVO;
import com.yonyou.pmclouds.organization.mapper.RoleDistributeMapper;
import com.yonyou.pmclouds.organization.rmiitf.RoleDistributeQuery;
import org.springframework.beans.factory.annotation.Autowired;

@Service(version = ApplicationConsts.APPLICATION_VERSION,interfaceClass= RoleDistributeQuery.class)
public class RoleDistributeQueryImpl implements RoleDistributeQuery {

    @Autowired
    private RoleDistributeMapper roleDistributeMapper;

    @Override
    public RoleDistributeVO[] queryRoleDistribute(String pkTenant) throws BusinessException {
        RoleDistributeVO[] roleDistributeVOS = roleDistributeMapper.getRoleDistribute(pkTenant);
        if(roleDistributeVOS == null) return new RoleDistributeVO[0];
        return roleDistributeVOS;
    }
}
